using System;

namespace Woz
{
    /// <summary>
    /// indicates which side of the stylus the screen is interacting with
    /// </summary>
    public enum StylusSide
    {
        /// <summary>
        /// indicates that the screen is interacting with the flat side of the stylus
        /// </summary>
        FlatSide,

        /// <summary>
        /// indicates that the screen is interacting with the pointy side of the stylus
        /// </summary>
        PointySide
    }

    /// <summary>
    /// provides stylus flipped data for the stylus flipped event
    /// </summary>
    public sealed class StylusFlippedEventArgs : EventArgs
    {
        /// <summary>
        /// initializes the static variables penside and eraserside
        /// </summary>
        static StylusFlippedEventArgs()
        {
            // initialize the pointy side
            PointySide = new Woz.StylusFlippedEventArgs(Woz.StylusSide.PointySide);

            // initialize the flat side
            FlatSide = new Woz.StylusFlippedEventArgs(Woz.StylusSide.FlatSide);
        }

        /// <summary>
        /// provides stylus flipped data for the stylus flipped event
        /// </summary>
        /// <param name="pStylusSide">the side the stylus is flipped to</param>
        public StylusFlippedEventArgs(Woz.StylusSide pStylusSide)
        {
            this.mStylusSide = pStylusSide;
        }

        /// <summary>
        /// gets or sets the stylus side
        /// </summary>
        public Woz.StylusSide StylusSide
        {
            get { return this.mStylusSide; }
        }

        /// <summary>
        /// represents a stylus flipped to the pointy side
        /// </summary>
        public static readonly Woz.StylusFlippedEventArgs PointySide;

        /// <summary>
        /// represents a stylus flipped to the flat side
        /// </summary>
        public static readonly Woz.StylusFlippedEventArgs FlatSide;

        /// <summary>
        /// represents the side the stylus is flipped to
        /// </summary>
        private Woz.StylusSide mStylusSide;
    }

    /// <summary>
    /// represents the method that will handle the stylus flipped events to indicate which side the 
    /// stylus is facing when the stylus is flipped
    /// </summary>
    /// <param name="pSender">the tool that envoked the event</param>
    /// <param name="pStylusFlippedEventArgs">the stylus flipped data that tells us which side the stylus is facing</param>
    public delegate void StylusFlippedEventHandler(Woz.Tool pSender, Woz.StylusFlippedEventArgs pStylusFlippedEventArgs);
}
